package com.tmy.entity;

import com.alibaba.fastjson2.JSONArray;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
@TableName(value = "tab_order",autoResultMap = true)
public class Order implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.AUTO)
    /**
     * 序号id
     */
    private Integer id;

    /**
     * 下单用户
     */
    private String userId;

    /**
     * 订单id
     */
    private String orderId;

    /**
     * 入住人信息id
     */
    @TableField(typeHandler = FastjsonTypeHandler.class)
    private JSONArray peopleList;

    /**
     * 酒店id
     */
    private String hotelId;
    /**
     * 预定房型id
     */
    private String roomId;

    /**
     * 预定几晚
     */
    private Integer nights;

    /**
     * 总价
     */
    private Double price;

    /**
     * 订单状态
     */
    private String status;

    /**
     * 入住时间
     */
    private String startDate;

    /**
     * 结束时间
     */
    private String endDate;

    /**
     * 下单时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;

}